#!/usr/bin/env bash

echo "Start building demo-service"

echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "[INFO]开始打Maven包......"
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"

mvn clean package -Dmaven.test.skip -U

if [ $? -ne 0 ]; then
    echo ""
    echo "***********************************************************"
    echo "[INFO]Maven打包失败"
    echo "***********************************************************"
    exit 1
fi
echo "[INFO]Maven打包成功"

echo "[INFO]将target下包拷贝至output....."
cp -f target/demo_service_runnable.jar output/demo_service_runnable.jar
echo ""
echo "***********************************************************"
echo "[INFO]拷贝成功!!!!"
echo "***********************************************************"

exit 0